package bma.common.langutil.core;

import java.util.Iterator;

public class IteratorUtil {

	public static <IN, OUT> Iterator<OUT> wrap(final Iterator<IN> it,
			final Function<? super IN, OUT> co) {
		return new Iterator<OUT>() {

			@Override
			public boolean hasNext() {
				return it.hasNext();
			}

			@Override
			public OUT next() {
				return co.apply(it.next());
			}

			@Override
			public void remove() {
				it.remove();
			}

		};
	}
}
